#!/usr/bin/env python
# encoding=utf-8


from dao import insert_into_mongo


SEARCH_EVENT = 'search'
VIEW_PAGE_EVENT = 'viewPage'
VIEW_SEARCH_EVENT = 'viewSearch'
VIEW_DETAIL_EVENT = 'viewDetail'
LOGIN_EVENT = 'login'
LOGOUT_EVENT = 'logout'
SIGNUP_EVENT = 'signup'
WECHAT_MSG_EVENT = 'wechatMsg'
COLLECT_EVENT = 'collect'
NO_COLLECT_EVENT = 'no-collect'


def log(logitem):
    if not isinstance(logitem, dict):
        raise ValueError('log item error.')
    insert_into_mongo('lawyer_asst', 'userLog', logitem)
